package com.cq.hd.order.service;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.common.pagination.Page;
import com.cq.hd.order.api.dto.*;
import com.cq.hd.order.api.pft.PftOrderCallBackParam;
import com.cq.hd.order.api.pft.PftOrderTicketParam;
import com.cq.hd.order.api.vo.*;
import com.cq.hd.order.param.CancelWaitPayOrVerifyOrderParam;
import com.cq.hd.order.po.TbOrderPo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author mYunYu
 * @since 2023-12-13
 */
public interface TbOrderService extends IService<TbOrderPo> {

    Boolean getRedAvailableStatus(Long activeId, Long userId);

    Integer getActiveOrderNum(Long activeId, Long userId);

    ActiveOrderStatisticsVo getOrderStatistics(Long businessId, Long userId, Long activeId);

    CreateOrderVo createOrder(CreateOrderDto createOrderDto);

    CreateOrderVo createGroupBuyOrder(CreateOrderDto createOrderDto);

    CreateOrderVo createPointsOrder(CreateOrderDto createOrderDto);

    OrderPayVo pay(OrderPayDto orderPayDto);

    Boolean cancelPay(CancelPayDto cancelPayDto);

    Page<AppOrderPageVo> pageAppOrder(AppOrderPageDto appOrderPageDto);

    Page<MyPrizeOrderPageVo> pageMyPrizeOrder(MyPrizePageDto myPrizePageDto);

    AppOrderDetailVo appOrderDetail(AppOrderDetailDto appOrderDetailDto);

    AppGroupBuyOrderDetailVo appGroupBuyOrderDetail(AppGroupBuyOrderDetailQueryDto appGroupBuyOrderDetailQueryDto);

    AppOrderEnrollActiveDetail appOrderEnrollActiveDetail(AppOrderEnrollActiveDetailDto appOrderEnrollActiveDetailDto);

    Boolean cancelOrder(CancelOrderDto cancelOrderDto);

    Boolean cancelWaitPayOrVerifyOrder(CancelWaitPayOrVerifyOrderParam cancelWaitPayOrVerifyOrderParam);

    Boolean confirmJoin(ConfirmJoinDto confirmJoinDto);

    Page<AdminOrderPageVo> pageAdminOrder(AdminOrderPageDto adminOrderPageDto);

    Page<AdminPointsOrderPageVo> pageAdminPointsOrder(AdminPointsOrderPageDto adminPointsOrderPageDto);

    Page<AdminCommissionOrderPageVo> pageAdminCommissionOrder(AdminCommissionOrderPageDto adminCommissionOrderPageDto);

    List<AdminCommissionOrderPageVo> listAdminCommissionOrder(AdminCommissionOrderPageDto adminCommissionOrderPageDto);

    List<AdminPointsOrderPageVo> listAdminPointsOrder(AdminPointsOrderPageDto adminPointsOrderPageDto);

    void businessOrderAudit(OrderAuditDto orderAuditDto);

    AdminGroupOrderDetailVo detailAdminGroupOrder(Long orderId);

    AdminEnrollOrderDetailVo detailAdminEnrollOrder(Long orderId);

    AdminOrderDetailVo detailAdminOrder(Long orderId);

    List<AdminOrderCountVo> getOrderCount(AdminOrderCountDto adminOrderCountDto);

    Page<MerchantOrderPageVo> pageMerchantOrder(MerchantOrderPageDto merchantOrderPageDto);

    List<MerchantOrderExportVo> exportMerchantOrder(MerchantOrderExportDto merchantOrderExportDto);

    MerchantOrderDetailVo detailMerchantOrder(Long orderItemId, Long merchantId);

    MerchantVerifyConfirmVo getByVerifyCode(String verifyCode, Long merchantId);

    Boolean verify(MerchantVerifyDto merchantVerifyDto);

    Boolean pftVerify(PftOrderCallBackParam param);

    Boolean pftTicket(PftOrderTicketParam param);

    Page<MerchantVerifyRecordPageVo> pageVerifyRecord(MerchantVerifyRecordPageDto merchantVerifyRecordPageDto);
    
    Page<AdminVerifyRecordPageVo> pageAdminVerifyRecord(ActiveVerifyRecordQueryDto activeVerifyRecordQueryDto);

    List<AdminVerifyRecordPageVo> listAdminVerifyRecord(ActiveVerifyRecordQueryDto activeVerifyRecordQueryDto);

    List<ActiveVerifyMerchantVo> listVerifyMerchant(Long activeId);

    Page<MerchantVerifyGoodsPageVo> pageVerifyGoods(MerchantVerifyGoodsPageDto merchantVerifyGoodsPageDto);

    Page<MerchantVerifyGoodsDetailPageVo> pageVerifyGoodsDetail(MerchantVerifyGoodsDetailPageDto merchantVerifyGoodsDetailPageDto);

    List<OrderVo> listByDto(OrderDto orderDto);

    Integer userBusinessOrderCount(Long userId, Long businessId);

    Integer userActiveOrderCount(Long userId, Long activeId);

    Boolean consumerOrderDelayMsg(String orderNo);

    Boolean systemCancelPay(CancelPayDto cancelPayDto);

    Boolean queryOrderPay(OrderPayQueryDto orderPayQueryDto);

    Boolean consumerOrderRefundMsg(Long orderRefundId);

    Boolean consumerOrderVerifyMsg(Long orderId);

    List<OrderAvatarVo> listAvatarByDto(OrderDto orderDto);

    Boolean preOrderCallback(JSONObject dataObj);

    Boolean refundCallback(JSONObject dataObj);

    Boolean jsPayCallback(JSONObject dataObj);

    Boolean scanWaitePayOrder();

    Boolean scanPayingOrder();

    Boolean scanEndVerifyOrder();

    Boolean scanOrderSettleBill();

    Boolean scanVerifiedOrder();
    Boolean generateOrderSettleBillFeeTemp();
    Boolean scanOrderSettleBillFeeTemp();

    List<AdminOrderPageVo> listAdminOrder(AdminOrderPageDto adminOrderPageDto);

    List<String> getLastAvatar(Integer count);

    Boolean toPay(OrderPayQueryDto orderPayQueryDto);

    List<AdminOrderPageVo> listOrderByWithdrawalId(Long withdrawalId);

    ActiveAgentRankVo agentRank(Long activeId);

    Page<AgentRankItemVo> pageAgentRank(ActiveRankQueryDto activeRankQueryDto);

    // 活动结束
    void onActiveEnd(Long activeId);

    // 商户订单统计
    MerchantOrderStatisticsVo getMerchantOrderStatistics(MerchantOrderPageDto merchantOrderPageDto);

    // 经纪人预估佣金统计
    OrderEstimateCommissionVo getOrderEstimateCommission(Long agentId);

}
